<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in.0v0</name>
<id>-1</id>
<cardCount>4</cardCount>
<cardID>3051</cardID>
<listID>2301</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>416</width>
<height>264</height>
</cardSize>
<script>-- FX窶「Mailer - Stack Script-- Last Modified: 8/23/95 by MMM-- A freeware script provided by the Ruskin Group, Inc.-- This stack may be used for any non-commercial purposes.-- Hold down the Option Key and click on the "FX" text in the top-- left corner of the card to reveal/hide the AppleScript Buttons-- that are associated with the current card. For the purposes of-- this stack we have isolated all of the AppleScript scripts to-- buttons. All other scripts (eg. card, stack, etc. ) are HyperTalk.function returnAddr positionglobal globalAddr-- put "returning "&(item position of globalAddr)&" for "&positionreturn (item position of globalAddr)end returnAddr-- Set up some globals, and initialize the reader card...on openStack-- Exit from HyperCard if we're not running 2.3 or greater...if (the version)< 2.2 thenanswer "Sorry, you must have version 2.2 or later of HyperCard to run FX窶「Mailer."if the number of lines of the stacks > 1 thengo backelsedomenu "Quit"end ifend ifif there is not a scriptingLanguage AppleScript thenanswer "Sorry, you must have AppleScript enabled on this machine to run FX窶「Mailer."if the number of lines of the stacks > 1 thengo backelsedomenu "Quit"end ifend ifglobal FXstackVersion, FXtickcount, FXoriginalTextArrowsglobal FXcaptionsNeedUpdatingput true into FXcaptionsNeedUpdating -- Update when we open stack...set the cursor to busycreateMenusgo card "readerCard" -- Make sure we show the reader first...-- Clear the primary fields of the Reader Card...put "" into cd field captionsput "" into cd field bodyput "" into cd field subjectLBL-- Intialize our Globalsput "Version 1.0v0" into FXstackVersion -- used to tag messagesput the ticks into FXtickcount -- used by idle handler-- Attempt to get the FX窶「Engine registration names, note-- this AppleScript handler will pass control back to HyperCard-- upon completion by calling the setUserName handler.set the cursor to busysend "getAddr" to cd button "asGetAddr"-- We save the original state of the textArrows as we'll be-- changing it to keep the arrows from navigating through the-- stack from card to card (we use them to show the next and-- previous message) BUT we'd like to return "textArrows" to-- whatever it's original state was when we're done.put the textArrows into FXoriginalTextArrowsend openStack-- We only create one menu to facilitate jumping between the Reader-- and Compose cards.on createMenus-- add the FX Menucreate menu "FX窶「Mailer"put "Read Messages" into menu "FX窶「Mailer"put "Compose Message" after menu "FX窶「Mailer"set the enabled of menuItem "Read Messages" of menu "FX窶「Mailer" to falseset the enabled of menuItem "Compose Message" of menu "FX窶「Mailer" to true-- Delete the menus that don't function in this stack,-- but keep the menus that have functions used to examine-- the scripts of the various objects (eg. Card, Stack, Buttons...).delete menu "Font"delete menu "Style"end createMenus-- Catch FX窶「Mailer Menu selections and deal with them accordingly...on doMenu param1if param1 = "Read Messages" then -- Jump to the Reader Cardgo card readerCardelseif param1 = "Compose Message" then -- Jump to the Mailer Cardgo card composeCardend ifend ifpass doMenuend doMenu----------------------------------- Utility Functions For Stack ------------------------------------- This handler keeps a copy of the last thing typed in the message-- box around to help debugging. Hit option-return to load last item.on returnKeyglobal MyLastMsgif the optionKey is down then put MyLastMsg into the msg boxelseput the msg box into MyLastMsgpass returnKeyend ifend returnKey-- This handler returns a data and time string in a standard format-- of mm/dd/yy-HH:MM?M which is used to tag the begining of captions.function buildDateTimeStampput the date into rawTimeStampconvert rawTimeStamp to dateItemsif (item 2 of rawTimeStamp) < 10 thenput "0"&(item 2 of rawTimeStamp)&"/" into prettyTimeStampelseput (item 2 of rawTimeStamp)&"/" into prettyTimeStampend ifif (item 3 of rawTimeStamp) < 10 thenput "0"&(item 3 of rawTimeStamp)&"/" after prettyTimeStampelseput (item 3 of rawTimeStamp)&"/" after prettyTimeStampend ifput (char 3 to 4 of item 1 of rawTimeStamp)&"-" after prettyTimeStampput the time into rawTimeStampif (length of rawTimeStamp) < 8 thenput "0"&rawTimeStamp after prettyTimeStampelseput rawTimeStamp after prettyTimeStampend ifdelete char 15 of prettyTimeStampreturn prettyTimeStampend buildDateTimeStamp-- This function return name of the hard drive where this-- stack is located. Need not be the startup volume's name.function getDriveNameput word 2 of the long name of this stack into tmpFlddelete char 1 of tmpFldput empty into driveNameput 1 into charPosrepeat until (char charPos of tmpFld) is ":"if (char charPos of tmpFld) 竕 ":" thenput char charPos of tmpFld after driveNameend ifadd 1 to charPosend repeatreturn driveNameend getDriveName</script>